package com.woniuxy.gateway.config;

import org.springframework.stereotype.Component;
import springfox.documentation.swagger.web.SwaggerResource;
import springfox.documentation.swagger.web.SwaggerResourcesProvider;

import java.util.Arrays;
import java.util.List;

@Component
public class SwaggerResourceConfig implements SwaggerResourcesProvider {


    @Override
    public List<SwaggerResource> get() {
        return Arrays.asList(
                creat("物业服务","/certified/v2/api-docs"),
                creat("用户服务","/user/v2/api-docs"),
                creat("订单服务","/order/v2/api-docs"),
                creat("平台服务","/platform/v2/api-docs"),
                creat("出租客服务","/renters/v2/api-docs"),
                creat("车位服务","/stall/v2/api-docs"),
                creat("营收服务","/income/v2/api-docs")
        );
    }

    private SwaggerResource creat(String name, String url){
        SwaggerResource sr = new SwaggerResource();
        sr.setLocation(url);
        sr.setName(name);
        sr.setSwaggerVersion("2.0");
        return sr;
    }

}
